Skip to content

feat: thread UseOneMinuteIntervals flag through calc helpers (Phase 0, no-op)#1540

Merged
renemadsen merged 1 commit into
stablefrom
feat/use-one-minute-intervals-phase-0-thread-flag
May 2, 2026
Merged

feat: thread UseOneMinuteIntervals flag through calc helpers (Phase 0, no-op)#1540
renemadsen merged 1 commit into
stablefrom
feat/use-one-minute-intervals-phase-0-thread-flag

Conversation

@renemadsen
Copy link
Copy Markdown
Member

Summary

  • Phase 0 of the UseOneMinuteIntervals second-precision rollout (plan: /home/rene/.claude/plans/parallel-twirling-balloon.md).
  • Plumbing only — zero behavior change. Threads the UseOneMinuteIntervals flag through three calculation helpers as no-op stubs.
  • CalculatePauseAutoBreakCalculationActive already takes AssignedSite, so signature is unchanged; an if (assignedSite.UseOneMinuteIntervals) { /* TODO Phase 1+2 */ } block is added that intentionally falls through to the existing 5-minute logic.
  • RecalculatePlanHoursFromShifts(PlanRegistration) keeps its existing body byte-identical; a new 2-arg overload (PlanRegistration, bool useOneMinuteIntervals) delegates to the 1-arg method (planned-shift precision stays minute-only per the plan).
  • RoundDownToNearestFiveMinutesAndFormat(DateTime, int) keeps its existing body byte-identical; a new 3-arg overload delegates to the existing 2-arg helper.
  • ContentHandoverService.AcceptHandoverRequestAsync (lines 638-639) updated to pass fromAssignedSite?.UseOneMinuteIntervals ?? false / toAssignedSite?.UseOneMinuteIntervals ?? false to the new 2-arg overload.
  • Other callers of CalculatePauseAutoBreakCalculationActive (AbsenceRequestService, TimePlanningPlanningService x2, TimePlanningWorkingHoursService x4) need no change — signature unchanged.
  • Other callers of RoundDownToNearestFiveMinutesAndFormat (TimePlanningWorkingHoursService.ReadSimple x6) do not have assignedSite in scope; per the plan they remain on the existing 2-arg signature.

New tests (additions only — no existing tests edited)

  • CalculatePauseAutoBreakCalculationActive_FlagOnAndFlagOff_ReturnSamePauseId — proves the new if-branch is a true no-op (Pause1Id..Pause5Id byte-identical).
  • RecalculatePlanHoursFromShifts_FlagOnAndFlagOff_ReturnSamePlanHours — proves the 1-arg, 2-arg(false), and 2-arg(true) paths produce identical PlanHours and PlanHoursInSeconds.
  • RoundDownToNearestFiveMinutesAndFormat_FlagOnAndFlagOff_ReturnSameString[Ignore]d carve-out: helper is private static and the public consumer (ReadSimple) requires SDK/DB fixture not yet wired in this test project. Assertion captured for future fixture work.

Test plan

  • dotnet clean + build at host root succeeds (0 errors)
  • CI green on plugin repo PR
  • All existing tests pass unchanged
  • New tests pass (the two non-Ignored ones)

Phases 1-4 will replace the stub branches with true second-precision logic.

🤖 Generated with Claude Code

…pers (no-op stubs)

Phase 0 of the UseOneMinuteIntervals second-precision rollout.
This PR is plumbing-only with zero behavior change: it adds the
flag parameter to CalculatePauseAutoBreakCalculationActive (already
has assignedSite, just adds an internal if/else stub),
RecalculatePlanHoursFromShifts (new 2-arg overload that delegates
to existing 1-arg), and RoundDownToNearestFiveMinutesAndFormat
(new 3-arg overload that delegates to existing 2-arg).

All callers with ready access to AssignedSite are updated to pass
the flag. Existing helper bodies are unchanged.

New tests assert flag-on and flag-off paths return byte-identical
results in this phase, proving the stubs are true no-ops.

Subsequent phases (1-4) will replace the stub branches with true
second-precision logic. Plan: /home/rene/.claude/plans/parallel-twirling-balloon.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@renemadsen renemadsen merged commit 8865fb5 into stable May 2, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant